package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
* @author Zhang xing wang
* @date 2020-03-26
*/
@Entity
@Data
@Table(name="department")
public class Department implements Serializable {

    // 编号
    @Id
    @Column(name = "id")
    private String id;

    // 父类id
    @Column(name = "parent_id")
    private String parentId;

    // 名称
    @Column(name = "name")
    private String name;

    // 医院ID
    @Column(name = "hospital_id")
    private String hospitalId;

    // 编码
    @Column(name = "code")
    private String code;

    // 创建者
    @Column(name = "create_by")
    private String createBy;

    // 更新者
    @Column(name = "update_by")
    private String updateBy;

    // 备注信息
    @Column(name = "remarks")
    private String remarks;

    // 删除标记
    @Column(name = "del_flag")
    private String delFlag;

    @Column(name = "ks_image")
    private String ksImage;

    public void copy(Department source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}